function delay(ms) {
  return new Promise(resolve => {
    setTimeout(() => {
      resolve();
    }, ms);
  });
}

async function main() {
    // 异步操作
    console.log('开始');
    await delay(2000);
    console.log('结束');
}
